﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using SqlMiM.ReportingServices.SqlRs;


namespace SqlMiM.ReportingServices.Converters
{
    public class CatalogTypeIconConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null)
                return Binding.DoNothing;

            ItemTypeEnum itemType = (ItemTypeEnum)value;

            switch (itemType)
            {
                case ItemTypeEnum.DataSource: return "/Images/database_gear.png";
                case ItemTypeEnum.Folder: return "/Images/folder.png";
                case ItemTypeEnum.Report: return "/Images/report.png";
                case ItemTypeEnum.LinkedReport: return "/Images/report_link.png";
                case ItemTypeEnum.Model: return "/Images/chart_organisation.png";
                case ItemTypeEnum.Resource: return "/Images/cog.png";
                case ItemTypeEnum.Unknown: return "/Images/error.png";

            }

            return "/Images/error.png";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
